<template>
  <!-- <div class="block">
        <span class="demonstration">默认</span>
        <el-date-picker v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期"
            end-placeholder="结束日期">
        </el-date-picker>
    </div> -->
  <!-- <div class="block">
        <span class="demonstration">带快捷选项</span>
        <el-date-picker v-model="value2" type="datetimerange" :picker-options="pickerOptions" range-separator="至"
            start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="getTIme"
            value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss">
        </el-date-picker>
    </div> -->
  <!-- Tab切换 type="border-card"-->
  <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
    <el-tab-pane label="sku视角" name="0">
      <I />
    </el-tab-pane>
    <el-tab-pane label="skc视角" name="1">
      <II />
    </el-tab-pane>
    <el-tab-pane label="spu视角" name="2">
      <III />
    </el-tab-pane>
    <!-- <el-tab-pane label="商品视角" name="2">
      <II :message="parentMessage" />
    </el-tab-pane>
    <el-tab-pane label="季节视角" name="3">
      <III />
    </el-tab-pane> -->
  </el-tabs>
</template>

<script>
// src/views/purchase/inventory/index.vue
// src/views/purchase/TPinventory/index.vue
import I from "./sku.vue";
import II from "./skc.vue";
import III from "./spu.vue";
import IV from "@/views/Warehouse/AgeDetail/IV.vue";
// import UidCreativity from "@/views/keyword/UidCreativity/index.vue";
// import UidMaterial from "@/views/keyword/UidMaterial/index.vue";

export default {
  components: {
    // UidCreativit
    I,
    II,
    III,
    IV,
  },
  data() {
    return {
      activeName: "0",
      parentMessage: "",
    };
  },
  mounted() {
    // this.userOrigin()
    // this.handleClick()
  },
  methods: {
    handleClick(tab, event) {
      // console.log(tab.index)
      // tab.index 表示当前标签页为多少，这是一个字符串类型
      if (tab.index === "0") {
        // 发起访问第一个数据报表的请求
        this.userOrigin();
      } else if (tab.index === "1") {
        this.pageAccess();
      } else if (tab.index === "2") {
        this.parentMessage = "2";
      }
    },
    userOrigin() {
      console.log(0);
    },
    pageAccess() {
      console.log(1);
      this.parentMessage = "1";
      // this.$emit("handleChartData", 1);
    },
  },
};
</script>
<style lang="scss"></style>
